package com.bytezero.bank;

public class Bank {

	private Customer[] customers; //存放多个客户的数组
	
	//private Customer[] customers=10; //1:
	private int numberOfCustomers; //记录客户的个数
	
	public Bank()
	{
		customers = new Customer[10];  //1:
	}
	
	//添加客户
	public void addCustomer(String f,String l)
	{
		Customer cust = new Customer(f,l);
//		customers[numberOfCustomers] = cust;
//		numberOfCustomers++;
		customers[numberOfCustomers++] = cust;
		
		
	}
	
	
	//获取客户的个数
	public int getNumberOfCustomers()
	{
		return numberOfCustomers;
	}
	
	//取指定位置的客户
	public Customer getCunstomer(int index)
	{
//		return customers[index];   //可能报异常
		if(index >= 0 && index < numberOfCustomers)
		{
			return customers[index];
		}
		
		return null;
	}
	
}



















